<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Setting of your database!</title>
<script type="text/javascript" src="jquery-1.8.3.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$('#add').submit(function(){
			$.ajax({
				type: "POST",
				url: "AdminServlet",
				data: {code: $('#code').val(), title: $('#title').val(), dBegin: $('#dbegin'), dEnd: $('#dend'), loc: $('#location')},
				success: function(data){
					alert("Success to add the course");
				}
			});
			
		});
	});

</script>
</head>
<body>

<form name="adminPage" method="POST" id="adminPage">
	<h3>add course</h3>
	Code <input type="text" name="code" id="code"/><br/>	
	Title <input type="text" name="title" id="title"/><br/>
	Date begin <input type="text" name="dbegin" id="dbegin"/><br/>
	Date end <input type="text" name="dend" id="dend"/><br/>
	Location <input type="text" name="location" id="location"/><br/>
			
	<input type="submit" value="Add" id="add"/><br/>
</form>

</body>
</html>